package com.xingda.packing.dmds.minitor.controller;

import com.xingda.packing.dmds.common.BaseController;
import com.xingda.packing.dmds.common.R;
import com.xingda.packing.dmds.minitor.dto.PkBoxLocationDto;
import com.xingda.packing.dmds.minitor.entity.PkBoxLocation;
import com.xingda.packing.dmds.minitor.service.IPkBoxLocationService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author anxiaoning
 * @since 2021-07-03
 */

@RestController("pkBoxLocationDMDScontroller")
@RequestMapping("/api/boxLocation")
public class PkBoxLocationController extends BaseController {
    @Resource
    private IPkBoxLocationService pkBoxLocationService;

    @GetMapping("/minitor/{area}")
    public R getList(@PathVariable int area) {
        List<PkBoxLocationDto> list = pkBoxLocationService.getPkBoxLocationList(0, area);
        return R.ok().put("data", list);
    }

    @GetMapping("/getList")
    public R getPkBoxLocationList() {
        List<PkBoxLocation> list = pkBoxLocationService.lambdaQuery().list();
        return R.ok().put("data", list);
    }
}

